﻿// ****************************************************************************
// <copyright file="MessageBase.cs" company="GalaSoft Laurent Bugnion">
// Copyright © GalaSoft Laurent Bugnion 2009-2013
// </copyright>
// ****************************************************************************
// <author>Laurent Bugnion</author>
// <email>laurent@galasoft.ch</email>
// <date>13.4.2009</date>
// <project>GalaSoft.MvvmLight.Messaging</project>
// <web>http://www.galasoft.ch</web>
// <license>
// See license.txt in this project or http://www.galasoft.ch/license_MIT.txt
// </license>
// ****************************************************************************
namespace TimersXP.Messaging
{
    /// <summary>Base class for all messages broadcasted by the Messenger. You can create your own message types by extending this class.</summary>
    public class MessageBase
    {
        #region Constructors
        /// <summary>Initializes a new instance of the <see cref="MessageBase"/> class.</summary>
        public MessageBase() { }

        /// <summary>Initializes a new instance of the <see cref="MessageBase"/> class.</summary>
        /// <param name="sender">The sender.</param>
        public MessageBase(object sender) { Sender = sender; }

        /// <summary>Initializes a new instance of the <see cref="MessageBase"/> class.</summary>
        /// <param name="sender">The message's original sender.</param>
        /// <param name="target">The message's intended target. This parameter can be used to give an indication as to whom the message was intended for.
        /// Or course this is only an indication, and may be null.</param>
        public MessageBase(object sender, object target) : this(sender) { Target = target; }
        #endregion Constructors

        #region Class Properties
        /// <summary>Gets or sets the sender.</summary>
        /// <value>The sender.</value>
        public object Sender { get; protected set; }

        /// <summary>
        /// Gets or sets the message's intended target. This property can be used to give an indication as to whom the message was intended for.
        /// Of course this is only an indication, and may be null.
        /// </summary>
        /// <value>The target.</value>
        public object Target { get; protected set; }
        #endregion Class Properties
    }
}
